package com.woniuxy02;

/**
 * @author 作者
 * @create 2025-07-24 10:53
 */
public class Test01 {
    public static void main(String[] args) {
        //用户需要一辆车
        String type="bmw";
        Car car = CarFactory.createCar(type);
        car.run();


        type="benz";
        car = CarFactory.createCar(type);
        car.run();
    }

    private static void test01() {
        Car car=new Bmw();
        car.run();

        car=new Benz();
        car.run();
    }
}
